<template>
  <div id="historyChart"></div>
</template>

<script setup>
import { historyWarning } from '@/cesiumTools/echartsOpts';
import * as echarts from 'echarts'; //原生echarts  第一步引入
import { onMounted } from 'vue';
import { historyWarningData } from '@/store/staticData';

onMounted(() => {
  initChart();
});

const initChart = () => {
  // 第二步指定容器  容器必须有宽高,不管是原生还是vue-chart
  const myChart = echarts.init(document.getElementById('historyChart'));
  const options = historyWarning(historyWarningData);
  //   第三步设置属性
  myChart.setOption(options);
};
</script>
<style scoped lang="scss">
#historyChart {
  width: 500px;
  height: 230px;
  margin: 0 auto;
}
</style>
